function removeZero(arr) {
    let index = 0;
    for (let i = 0; i < arr.length; i++) {
        if (arr[i] != 0) {
            [arr[i], arr[index]] = [arr[index], arr[i]] // 当前项不为0 则执行
            index++;
        }
    }
    return arr
}

console.log(removeZero([0,1,1,0,3,0]))